<template>
  <div id="center">
    <!-- <div class="up">
      <div
        class="bg-color-black item"
        v-for="item in titleItem"
        :key="item.title"
      >
        <p class="ml-3 colorWhite fw-b">{{ item.title }}</p>
      </div>
    </div> -->

    <video id="myPlayer" controls playsInline webkit-playsinline autoplay="true" style="width:100%;height:4.6rem;margin-top: 0.1rem;"> </video>
  </div>
</template>

<script>
import flv from 'flv.js'
export default {
  data() {
    return {
      titleItem: [
        {
          title: "视频1",
        },
      ],
      player : null,
    playing: false,
    };
  },
  components: {},
  mounted()
  {
    var video = document.querySelector('#myPlayer')
    this.player.attachMediaElement(video)
    this.player.load()
  },
  created(){
    if(flv.isSupported()){
      this.player = flv.createPlayer({
        type: 'flv',
        url: 'https://rtmp01open.ys7.com:9188/v3/openlive/F59471658_1_1.flv?expire=1631786782&id=358312606624825344&t=7bb28899a3289083da56028284fc95f3c842ec5faca4aa98c48ffd5e34da43c7&ev=100'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
#center {
  display: flex;
  flex-direction: column;
  padding: 0.2rem;
  min-width: 5.6rem;
  .up {
    width: 25%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    .item {
      border-radius: 0.0625rem;
      margin-top: 0.1rem;
      width: 100%;
      height: 0.875rem;
      display: flex;
      align-items: center;
      font-size: 0.2rem;
    }
  }
  .down {
    padding: 0.07rem 0.05rem;
    padding-bottom: 0;
    width: 100%;
    display: flex;
    height: 3.1875rem;
    justify-content: space-between;
    .bg-color-black {
      border-radius: 0.0625rem;
    }
    .ranking {
      padding: 0.125rem;
      width: 59%;
    }
    .percent {
      width: 40%;
      display: flex;
      flex-wrap: wrap;
      .item {
        width: 50%;
        height: 1.5rem;
        span {
          margin-top: 0.0875rem;
          display: flex;
          justify-content: center;
        }
      }
      .water {
        width: 100%;
      }
    }
  }
}
</style>